﻿using MODEL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class DBContextFactory
    {
        //侯海啸
        public static ShopEntities GetEntities() {
            var obj = CallContext.GetData("dbContext");
            if (obj ==null) {
                ShopEntities entities = new ShopEntities();
                CallContext.SetData("dbContext", entities);
                return entities;
            }
            return (ShopEntities)obj;
        }
    }
}
